home *** CD-ROM | disk | FTP | other *** search
- Path: lugb.latrobe.edu.au!luxor!ccmrc
- From: ccmrc@luxor.latrobe.edu.au (Marcus Crafter)
- Newsgroups: comp.lang.c
- Subject: Help with Curses!
- Date: 31 Jan 1996 00:23:04 GMT
- Organization: La Trobe University
- Message-ID: <4emcp8$3i5@lugb.latrobe.edu.au>
- NNTP-Posting-Host: luxor.latrobe.edu.au
- X-Newsreader: TIN [version 1.2 PL2]
-
-
- Hi There !
-
- I am working on writing a curses application at the moment,
- but I can't seem to set the background of a curses based window
- regardless of what I try. Here is the code that won't work as an
- application itself, all I want it to do is clear the stdscr
- window to a blue background.
- Please! If someone can see what I am doing wrong, could they let
- me know!
-
- Thanks for your help
-
- Marcus
-
- -------------------------------------------------------------------------
- #include <ncurses.h>
- #include <stdlib.h>
-
- chtype attr;
-
- main()
- {
- initscr(); /* Init curses */
- keypad(stdscr, TRUE);
- cbreak();
- noecho();
-
- start_color();
-
- init_pair(1,COLOR_WHITE,COLOR_BLUE);
- attr = (0|COLOR_PAIR(1));
-
- wattrset(stdscr,attr);
- werase(stdscr);
-
- printw("Colors = %d Colour Pairs = %d\n",COLORS,COLOR_PAIRS);
-
- wnoutrefresh(stdscr);
-
- refresh();
- sleep(1);
- endwin();
- }
- -------------------------------------------------------------------------
-
- --
- ..... .....
- ,,$$$$$$$$$, ,$$$$$$$$$$,
- ;$' '$$$$: ;$' '$$$$:
- $: $$$$: $: $$$$: Marcus Crafter
- $ o_)$$$: $ o_) $$$: Computer Systems Engineering
- ;$, _/\ &&:' ;$, _/\ &&:' La Trobe University, Melbourne
- ' /( &&& ' /( &&& Australia
- \_&&&&' \_&&&&'
- &&&&. &&&&. e-Mail : m.crafter@latrobe.edu.au
- &&&&&&&: &&&&&&&&: Phone : 03 479 1895
- http://www.studyhall.latrobe.edu.au/crafterm/
-
- Pentium 120 PCI - 16 Meg EDO RAM - 1.6 GIG Seagate Medalist HDD - Sampo 17"
- Diamond Stealth 64 Video VRAM 2MEG - Quad Speed NEC CDROM !!
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- LINUX - Windows 95
- ~~~~~~~~~~~~~~~~~~
-